home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Converters / Filter-1.1 / Source / Filter.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  700 b   |  43 lines

  1. /*
  2.  
  3. File Filter.m
  4.  
  5. The Filter object responds to requests to open a file.  It looks up the appropriate application to use by checking the defaults database.
  6.  
  7. */
  8.  
  9. #import "Filter.h"
  10.  
  11.  
  12. /* ========================================================================== */
  13.  
  14.  
  15. @implementation Filter
  16.  
  17.  
  18. - (BOOL) appAcceptsAnotherFile: sender
  19. {
  20.     return YES;
  21. }
  22.  
  23.  
  24. - (int) app: sender  openFile: (const char *) filename
  25.             type: (const char *) aType
  26. {
  27.     const char *
  28.         app;
  29.     
  30.     app = NXReadDefault("Filter", aType);
  31.     if (app == NULL)
  32.     {
  33.         NXLogError ("No dwrite found for type %s.", aType);
  34.         NXBeep ();
  35.         return NO;
  36.     }
  37.     
  38.     else return [[Application  workspace]
  39.                         openFile: filename  withApplication: app];
  40. }
  41.  
  42.  
  43. @end